home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 12 - 1996 / 12.10 Oct 96 / GettingStarted / layoutWithPanel.java < prev    next >
Encoding:
Java Source  |  1996-09-11  |  571 b   |  27 lines  |  [TEXT/R*ch]

  1. import java.awt.*;
  2.  
  3. public class layoutWithPanel extends java.applet.Applet
  4. {
  5.     public layoutWithPanel()
  6.     {
  7.         setLayout( new BorderLayout() );
  8.         
  9.         Panel    top = new Panel();
  10.         Panel    bottom = new Panel();
  11.         
  12.         top.setLayout( new FlowLayout() );
  13.         
  14.         top.add( new Label( "Enter your name:" ) );
  15.         top.add( new TextField( "<Your name here>", 30 ) );
  16.         
  17.         bottom.setLayout( new FlowLayout() );
  18.         
  19.         bottom.add( new Button( "Eeny" ) );
  20.         bottom.add( new Button( "Meeny" ) );
  21.         bottom.add( new Button( "Miney-Moe" ) );
  22.         
  23.         add( "Center", top );
  24.         add( "South", bottom );        
  25.     }
  26. }
  27.